package com.vogue.supplymall.order.domain.dao.impl;

import com.vogue.supplymall.order.domain.dao.SupplierConsumerDao;
import com.vogue.supplymall.order.domain.mapper.SupplierConsumerMapper;
import com.vogue.supplymall.order.domain.model.SupplierConsumer;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

/**
 * The type Supplier consumer dao.
 *
 * @author zhangliang
 * @date Create in 2018-08-03
 */
@Repository("supplierConsumerDao")
public class SupplierConsumerDaoImpl extends BaseDaoImpl<SupplierConsumer, Long> implements SupplierConsumerDao {
    @Resource
    private SupplierConsumerMapper supplierConsumerMapper;
    
    @Override
	public List<Map<String, Object>> getBuyerInfoBySyscodeId(Long sellSyscodeId,Long buySyscodeId) {
		String sql="select sc.id,sc.buyorganid from supplier_consumer sc"
				+ " where sc.sellsyscodeid="+sellSyscodeId+" and sc.buysyscodeid="+buySyscodeId;
		
		return this.query(sql);
	}

	@Override
	public void updatePayMode(Long eId,int payMode,String date) {
		String sql="update supplier_consumer set paymode="+payMode+", "
				+ "modifydate='"+date+"'"
				+ " where id="+eId;
		
		this.update(sql);
		
	}
}
